package com.luzhikun.decorator;

import com.luzhikun.service.ISomeService;

/**
 * @Author Rookie Coder
 * @Description 装饰类
 * @Date 装饰类有两个要求
 * 要求1：装饰者要和目标类实现相同的接口
 * 要求2：装饰者类中要有目标对象作为成员变量，且目标对象是由带参构造器传入
 **/
public class SomeServiceDecorator implements ISomeService {

    private ISomeService iSe;

    public SomeServiceDecorator(ISomeService iSe) {
        this.iSe = iSe;
    }

    @Override
    public String doSome() {
        return iSe.doSome().toUpperCase();
    }
}
